package com.wangfei.swaggerdemo.config;


import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {
    @Bean
    public OpenAPI docsOpenAPI() {
        Info info = new Info()
                .title("项目接口")
//                .description("项目描述")
                .version("v0.0.1");
        return new OpenAPI().info(info);
    }

    @Bean
    public GroupedOpenApi apiApi() {
        return GroupedOpenApi.builder()
                .group("小程序端")
                .pathsToMatch("/api/**")
                .build();
    }

    @Bean
    public GroupedOpenApi manageApi() {
        return GroupedOpenApi.builder()
                .group("pc后台")
                .pathsToMatch("/manage/**")
                .build();
    }
}
